package com.tvunetworks.center.user.service;

import com.github.pagehelper.PageInfo;
import com.tvunetworks.center.common.model.LoginUser;
import com.tvunetworks.center.common.model.SearchDeviceParam;
import com.tvunetworks.center.common.model.dto.GeoDetail;
import com.tvunetworks.center.common.util.Result;
import com.tvunetworks.center.user.model.DeviceGeo;
import com.tvunetworks.center.user.model.param.PageDeviceGeoParam;
import com.tvunetworks.center.user.model.param.SaveDeviceGeoParam;
import com.tvunetworks.center.user.model.vo.DeviceGeoVo;

import java.util.List;
/**
 * @program: tvucc-aggregator
 * @author lebronchen
 * @create: 2020-04-24 13:17
 **/
public interface DeviceGeoService {
    /**
     *
     * @param loginUser loginUser
     * @param param param
     * @param deviceGeoParam deviceGeoParam
     * @param pageNum pageNum
     * @param pageSize pageSize
     * @param timeLockFlag timeLockFlag
     * @return PageInfo
     */
    PageInfo<DeviceGeoVo> pageDeviceGeo(LoginUser loginUser, SearchDeviceParam param, PageDeviceGeoParam deviceGeoParam,
                                        Integer pageNum, Integer pageSize, boolean timeLockFlag);

    /**
     *
     * @param param param
     * @param pageNum pageNum
     * @param pageSize pageSize
     * @return PageInfo
     */
    PageInfo<DeviceGeoVo> supportPage(PageDeviceGeoParam param, int pageNum, int pageSize);

    /**
     *
     * @param userId userId
     * @param param param
     * @param deviceGeoParam deviceGeoParam
     * @param pageNum pageNum
     * @param pageSize pageSize
     * @param timeLockFlag timeLockFlag
     * @return PageInfo
     */
    PageInfo<DeviceGeoVo> userPage(String userId, SearchDeviceParam param, PageDeviceGeoParam deviceGeoParam, Integer pageNum,
                                   Integer pageSize, boolean timeLockFlag);

    /**
     *
     * @param peerId peerId
     * @return DeviceGeoVo
     */
    DeviceGeoVo getDeviceGeo(String peerId);

    /**
     *
     * @param peerIds peerIds
     * @return List
     */
    List<com.tvunetworks.center.gs.model.DeviceGeo> getDeviceGeoByPeerIds(List<String> peerIds);

    /**
     *
     * @param peerId peerId
     * @return DeviceGeo
     */
    DeviceGeo getByPeerId(String peerId);

    /**
     *
     * @param param param
     * @return int
     */
    int saveDeviceGeo(SaveDeviceGeoParam param);

    /**
     * 通过设备查询设备位置
     * @param peerId peerId
     * @return Result
     */
    Result<String> getGeoNameByDevice(String peerId);

    /**
     *
     * @param peerId peerId
     * @return GeoDetail
     */
    GeoDetail getGeoByDeviceIp(String peerId);

    /**
     * initDeviceGeo
     */
    void initDeviceGeo();

    /**
     * 分页查询GeoDevice
     * @param loginUser 登录的用户
     * @param param 查询条件
     * @param deviceGeoParam 查询条件
     * @return 满足条件的分页结果
     */
    PageInfo<DeviceGeoVo> pageDeviceGeo(LoginUser loginUser, SearchDeviceParam param, PageDeviceGeoParam deviceGeoParam);
}
